<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>title</title>
    <script type="text/javascript" src="js/jquery-1.12.2.min.js"></script>
</head>
<body>
当前余额为：<span></span>元

<script>
    function updateHead() {
        $.ajax({
            type: "get",
            url: "user/query.do",
            dataType: "json",
            success: function (data) {
                if (data.code == 1) {
                    $("span").html(data.info.balance);
                }
            }
        })
    }

    $(function () {
        updateHead();
    })
</script>
</body>
</html>